home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / progra1a / aol40.bas next >
Encoding:
BASIC Source File  |  1999-09-03  |  21.0 KB  |  512 lines

  1. Attribute VB_Name = "NoFX"
  2. #If Win32 Then
  3. Private Declare Function ShowOwnedPopups& Lib "user32" (ByVal hWnd As Long, ByVal fShow As Long)
  4. #Else
  5. Private Declare Sub ShowOwnedPopups Lib "User" (ByVal hWnd As Integer, ByVal fShow As Integer)
  6. #End If 'WIN32
  7. #If Win32 Then
  8. Public Declare Function ShowWindow& Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long)
  9. #Else
  10. Public Declare Function ShowWindow% Lib "User" (ByVal hWnd As Integer, ByVal nCmdShow As Integer)
  11. #End If 'WIN32
  12. #If Win32 Then
  13. Public Declare Function CreateMDIWindow& Lib "user32" Alias "CreateMDIWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hInstance As Long, ByVal lParam As Long)
  14. Public Declare Function CreateMenu& Lib "user32" ()
  15. Public Declare Function CreatePopupMenu& Lib "user32" ()
  16. Public Declare Function CreateWindow& Lib "user32" Alias "CreateWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any)
  17. #Else
  18. 'Function CreateMDIWindow is not available in the WIN16 API.
  19. Public Declare Function CreateMenu% Lib "User" ()
  20. Public Declare Function CreatePopupMenu% Lib "User" ()
  21. Public Declare Function CreateWindow% Lib "User" (ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal X As Integer, ByVal Y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hWndParent As Integer, ByVal hMenu As Integer, ByVal hInstance As Integer, ByVal lpParam As String)
  22. #End If 'WIN32
  23. #If Win32 Then
  24. Public Declare Function SetClassWord& Lib "user32" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal wNewWord As Long)
  25. #Else
  26. Public Declare Function SetClassWord% Lib "User" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal wNewWord As Integer)
  27. #End If 'WIN32
  28. #If Win32 Then
  29. Public Declare Function DestroyWindow& Lib "user32" (ByVal hWnd As Long)
  30. #Else
  31. Public Declare Function DestroyWindow% Lib "User" (ByVal hWnd As Integer)
  32. #End If 'WIN32
  33. #If Win32 Then
  34. Public Declare Function EnableWindow& Lib "user32" (ByVal hWnd As Long, ByVal fEnable As Long)
  35. #Else
  36. Public Declare Function EnableWindow% Lib "User" (ByVal hWnd As Integer, ByVal aBOOL As Integer)
  37. #End If 'WIN32
  38. #If Win32 Then
  39. Public Declare Function SetFocusApi& Lib "user32" Alias "SetFocus" (ByVal hWnd As Long)
  40. #Else
  41. Public Declare Function SetFocusApi% Lib "User" Alias "SetFocus" (ByVal hWnd As Integer)
  42. #End If 'WIN32
  43. #If Win32 Then
  44. Public Declare Function WritePrivateProfileString& Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As Any, ByVal lpFileName As String)
  45. Public Declare Function GetPrivateProfileString& Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String)
  46. #Else
  47. Public Declare Function WritePrivateProfileString% Lib "kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lplFileName As String)
  48. Public Declare Function GetPrivateProfileString% Lib "kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String)
  49. #End If
  50. #If Win32 Then
  51. Public Declare Function SetSysColors& Lib "user32" (ByVal nChanges As Long, lpSysColor As Long, lpColorValues As Long)
  52. Public Declare Function GetSysColor& Lib "user32" (ByVal nIndex As Long)
  53. #Else
  54. Public Declare Sub SetSysColors Lib "User" (ByVal nChanges As Integer, lpSysColor As Integer, lpColorValues As Long)
  55. Public Declare Function GetSysColor& Lib "User" (ByVal nIndex As Integer)
  56. #End If
  57. Declare Function IsWindowEnabled Lib "user32" (ByVal hWnd As Long) As Long
  58. Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
  59. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hWnd As Long, lpdwProcessId As Long) As Long
  60. Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
  61. Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  62. Private Declare Sub RtlMoveMemory Lib "kernel32" (ByRef dest As Any, ByRef Source As Any, ByVal nBytes As Long)
  63. Declare Function RedrawWindow Lib "user32" (ByVal hWnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
  64. Declare Function MoveWindow Lib "user32" (ByVal hWnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
  65. Declare Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
  66. Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  67. Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
  68. Declare Function dwGetStringFromLPSTR Lib "dwspy32.dll" (ByVal lpcopy As Long) As String
  69. Declare Sub dwCopyDataBynum Lib "dwspy32.dll" Alias "dwCopyData" (ByVal Source&, ByVal dest&, ByVal nCount&)
  70. Declare Function dwGetAddressForObject& Lib "dwspy32.dll" (object As Any)
  71. Declare Sub dwCopyDataByString Lib "dwspy32.dll" Alias "dwCopyData" (ByVal Source As String, ByVal dest As Long, ByVal nCount&)
  72. Declare Function dwXCopyDataBynumFrom& Lib "dwspy32.dll" Alias "dwXCopyDataFrom" (ByVal mybuf As Long, ByVal foreignbuf As Long, ByVal size As Integer, ByVal foreignPID As Long)
  73. Declare Function dwGetWndInstance& Lib "dwspy32.dll" (ByVal hWnd&)
  74. Declare Function RegisterWindowMessage& Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpString As String)
  75. Declare Function GetWindowLong& Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long)
  76. Declare Function EnumWindows& Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long)
  77. Declare Function SendMessageByNum& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
  78. Declare Function GetClassName& Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long)
  79. Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  80. Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long
  81. Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hWnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
  82. Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long
  83. Declare Function Findwindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  84. Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
  85. Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
  86. Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
  87. Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
  88. Declare Function GetMenu Lib "user32" (ByVal hWnd As Long) As Long
  89. Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
  90. Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
  91. Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
  92. Declare Function gettopwindow Lib "user32" Alias "GetTopWindow" (ByVal hWnd As Long) As Long
  93. Declare Function SetWindowPos Lib "user32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  94. Declare Function GetMenuString Lib "user32" Alias "GetMenuStringA" (ByVal hMenu As Long, ByVal wIDItem As Long, ByVal lpString As String, ByVal nMaxCount As Long, ByVal wFlag As Long) As Long
  95. Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  96. Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
  97. Declare Function InsertMenu Lib "user32" Alias "InsertMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As Long
  98. Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As Long
  99. Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
  100. Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
  101. Declare Function DestroyMenu Lib "user32" (ByVal hMenu%) As Integer
  102. #If Win32 Then
  103. Public Const SND_ASYNC& = &H1
  104. Public Const SND_SYNC& = &H0
  105. #Else
  106. Public Const SND_ASYNC% = &H1
  107. Public Const SND_SYNC% = &H0
  108. #End If
  109. #If Win32 Then
  110. Public Declare Function sndPlaySound& Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)
  111. #Else
  112. Public Declare Function sndPlaySound% Lib "mmsystem.dll" (ByVal lpszSoundName As String, ByVal uFlags As Integer)
  113. #End If
  114. Public Const WM_CHAR = &H102
  115. Public Const WM_SETTEXT = &HC
  116. Public Const WM_USER = &H400
  117. Public Const WM_KEYDOWN = &H100
  118. Public Const WM_KEYUP = &H101
  119. Public Const WM_LBUTTONDOWN = &H201
  120. Public Const WM_LBUTTONUP = &H202
  121. Public Const WM_CLOSE = &H10
  122. Public Const WM_COMMAND = &H111
  123. Public Const WM_CLEAR = &H303
  124. Public Const WM_DESTROY = &H2
  125. Public Const WM_gettext = &HD
  126. Public Const WM_GETTEXTLENGTH = &HE
  127. Public Const WM_LBUTTONDBLCLK = &H203
  128. Public Const BM_GETCHECK = &HF0
  129. Public Const BM_GETSTATE = &HF2
  130. Public Const BM_SETCHECK = &HF1
  131. Public Const BM_SETSTATE = &HF3
  132.  
  133.  
  134. Public Const LB_GETITEMDATA = &H199
  135. Public Const LB_GETCOUNT = &H18B
  136. Public Const LB_ADDSTRING = &H180
  137. Public Const LB_DELETESTRING = &H182
  138. Public Const LB_FINDSTRING = &H18F
  139. Public Const LB_FINDSTRINGEXACT = &H1A2
  140. Public Const LB_GETCURSEL = &H188
  141. Public Const LB_GETtext = &H189
  142. Public Const LB_GETTEXTLEN = &H18A
  143. Public Const LB_SELECTSTRING = &H18C
  144. Public Const LB_SETCOUNT = &H1A7
  145. Public Const LB_SETCURSEL = &H186
  146. Public Const LB_SETSEL = &H185
  147. Public Const LB_INSERTSTRING = &H181
  148.  
  149. Public Const VK_HOME = &H24
  150. Public Const VK_RIGHT = &H27
  151. Public Const VK_CONTROL = &H11
  152. Public Const VK_DELETE = &H2E
  153. Public Const VK_DOWN = &H28
  154. Public Const VK_LEFT = &H25
  155. Public Const VK_RETURN = &HD
  156. Public Const VK_SPACE = &H20
  157. Public Const VK_TAB = &H9
  158.  
  159. Public Const HWND_TOP = 0
  160. Public Const HWND_TOPMOST = -1
  161. Public Const HWND_NOTOPMOST = -2
  162. Public Const SWP_NOMOVE = &H2
  163. Public Const SWP_NOSIZE = &H1
  164. Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  165. #If Win32 Then
  166. Public Const WS_VISIBLE& = &H10000000
  167. #Else
  168. Public Const WS_VISIBLE& = &H10000000
  169. #End If 'WIN32
  170. #If Win32 Then
  171. Public Const WM_TIMER& = &H113
  172. #Else
  173. Public Const WM_TIMER& = &H113
  174. #End If 'WIN32
  175. Public Const GW_CHILD = 5
  176. Public Const GW_HWNDFIRST = 0
  177. Public Const GW_HWNDLAST = 1
  178. Public Const GW_HWNDNEXT = 2
  179. Public Const GW_HWNDPREV = 3
  180. Public Const GW_MAX = 5
  181. Public Const GW_OWNER = 4
  182. Public Const SW_MAXIMIZE = 3
  183. Public Const SW_MINIMIZE = 6
  184. Public Const SW_HIDE = 0
  185. Public Const SW_RESTORE = 9
  186. Public Const SW_SHOW = 5
  187. Public Const SW_SHOWDEFAULT = 10
  188. Public Const SW_SHOWMAXIMIZED = 3
  189. Public Const SW_SHOWMINIMIZED = 2
  190. Public Const SW_SHOWMINNOACTIVE = 7
  191. Public Const SW_SHOWNOACTIVATE = 4
  192. Public Const SW_SHOWNORMAL = 1
  193.  
  194. Public Const MF_APPEND = &H100&
  195. Public Const MF_DELETE = &H200&
  196. Public Const MF_CHANGE = &H80&
  197. Public Const MF_ENABLED = &H0&
  198. Public Const MF_DISABLED = &H2&
  199. Public Const MF_REMOVE = &H1000&
  200. Public Const MF_POPUP = &H10&
  201. Public Const MF_STRING = &H0&
  202. Public Const MF_UNCHECKED = &H0&
  203. Public Const MF_CHECKED = &H8&
  204. Public Const MF_GRAYED = &H1&
  205. Public Const MF_BYPOSITION = &H400&
  206. Public Const MF_BYCOMMAND = &H0&
  207.  
  208. Public Const GWW_HINSTANCE = (-6)
  209. Public Const GWW_ID = (-12)
  210. Public Const GWL_STYLE = (-16)
  211.  
  212. Public Const PROCESS_VM_READ = &H10
  213. Public Const STANDARD_RIGHTS_REQUIRED = &HF0000
  214.  
  215. Type RECT
  216.    Left As Long
  217.    Top As Long
  218.    Right As Long
  219.    Bottom As Long
  220. End Type
  221.  
  222. Type POINTAPI
  223.    X As Long
  224.    Y As Long
  225. End Type
  226.  
  227.  
  228.  
  229.  
  230. Function FindChildByClass(parentw, childhand)
  231. firs% = GetWindow(parentw, 5)
  232. If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
  233. firs% = GetWindow(parentw, GW_CHILD)
  234. If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
  235.  
  236. While firs%
  237. firss% = GetWindow(parentw, 5)
  238. If UCase(Mid(GetClass(firss%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
  239. firs% = GetWindow(firs%, 2)
  240. If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
  241. Wend
  242. FindChildByClass = 0
  243.  
  244. bone:
  245. room% = firs%
  246. FindChildByClass = room%
  247.  
  248. End Function
  249.  
  250. Function FindChildByTitle(parentw, childhand)
  251. firs% = GetWindow(parentw, 5)
  252. If UCase(GetCaption(firs%)) Like UCase(childhand) Then GoTo bone
  253. firs% = GetWindow(parentw, GW_CHILD)
  254.  
  255. While firs%
  256. firss% = GetWindow(parentw, 5)
  257. If UCase(GetCaption(firss%)) Like UCase(childhand) & "*" Then GoTo bone
  258. firs% = GetWindow(firs%, 2)
  259. If UCase(GetCaption(firs%)) Like UCase(childhand) & "*" Then GoTo bone
  260. Wend
  261. FindChildByTitle = 0
  262.  
  263. bone:
  264. room% = firs%
  265. FindChildByTitle = room%
  266. End Function
  267.  
  268. Function GetCaption(hWnd)
  269. hwndLength% = GetWindowTextLength(hWnd)
  270. hwndTitle$ = String$(hwndLength%, 0)
  271. A% = GetWindowText(hWnd, hwndTitle$, (hwndLength% + 1))
  272.  
  273. GetCaption = hwndTitle$
  274. End Function
  275.  
  276. Function GetClass(child)
  277. buffer$ = String$(250, 0)
  278. getclas% = GetClassName(child, buffer$, 250)
  279.  
  280. GetClass = buffer$
  281. End Function
  282.  
  283. Function AOLGetChat()
  284.  
  285. child = FindChildByClass(childs%, "_AOL_View")
  286.  
  287. GetTrim = SendMessageByNum(child, 14, 0&, 0&)
  288. TrimSpace$ = Space$(GetTrim)
  289. GetString = SendMessageByString(child, 13, GetTrim + 1, TrimSpace$)
  290.  
  291. theview$ = TrimSpace$
  292. AOLGetChat = theview$
  293. End Function
  294.  
  295.  
  296. Public Function stayontop(the As Form)
  297. Flag% = SWP_NOMOVE Or SWP_NOSIZE
  298. lSetPos = SetWindowPos(the.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  299. End Function
  300.  
  301. Public Function PlayWav(FileName)
  302. Flagss% = SND_ASNC Or SND_SYNC
  303. Play2 = sndPlaySound(FileName, Flagss%)
  304. End Function
  305.  
  306. Public Function SetText(Text)
  307. lSetText = SendMessageByString(Wind&, WM_SETTEXT, 0, Text)
  308. End Function
  309.  
  310. Public Function Click(Window%)
  311. lClick& = SendMessage(Window%, WM_LBUTTONDOWN, 0, 0&)
  312. lClick& = SendMessage(Window%, WM_LBUTTONUP, 0, 0&)
  313. End Function
  314.  
  315. Public Function ChatSend(Text)
  316. AOL% = Findwindow("AOL Frame25", vbNullString)
  317. MDI% = FindChildByClass(AOL%, "MDIClient")
  318. firs% = GetWindow(MDI%, 5)
  319. listers% = FindChildByClass(firs%, "RICHCNTL")
  320. listere% = FindChildByClass(firs%, "_AOL_Listbox")
  321. listerb% = FindChildByClass(firs%, "_AOL_Combobox")
  322. If listers% And listere% And listerb% Then GoTo bone
  323.  
  324. firs% = GetWindow(MDI%, GW_CHILD)
  325. While firs%
  326. firs% = GetWindow(firs%, 2)
  327. listers% = FindChildByClass(firs%, "RICHCNTL")
  328. listere% = FindChildByClass(firs%, "_AOL_Listbox")
  329. listerb% = FindChildByClass(firs%, "_AOL_Combobox")
  330. If listers% And listere% And listerb% Then GoTo bone
  331. AOL% = Findwindow("AOL Frame25", vbNullString)
  332. MDI% = FindChildByClass(AOL%, "MDIClient")
  333. firs% = GetWindow(MDI%, 5)
  334. listers% = FindChildByClass(firs%, "RICHCNTL")
  335. listere% = FindChildByClass(firs%, "_AOL_Listbox")
  336. listerb% = FindChildByClass(firs%, "_AOL_Combobox")
  337. Listerc% = FindChildByClass(firs%, "_AOL_Glyph")
  338. Listerd% = FindChildByClass(firs%, "_AOL_Static")
  339. If listers% And listere% And listerb% Then GoTo bone Else Exit Function
  340. Wend
  341.  
  342. Fuck% = listers% And listere% And listerb%
  343. bone:
  344. One1% = GetWindow(listers%, 2)
  345. Two2% = GetWindow(One1%, 2)
  346. Three3% = GetWindow(Two2%, 2)
  347. Four4% = GetWindow(Three3%, 2)
  348. Five5% = GetWindow(Four4%, 2)
  349. six6% = GetWindow(Five5%, 2)
  350. Seve7% = GetWindow(six6%, 2)
  351. Eight8% = GetWindow(Seve7%, 2)
  352.  
  353. lSnd% = SendMessageByString(six6%, WM_SETTEXT, 0, Text)
  354. 'Click (Seve7%)
  355. lEnter% = SendMessageByNum(six6%, WM_CHAR, 13, 0&)
  356. End Function
  357.  
  358. Sub pause(interval)
  359. Current = Timer
  360. Do While Timer - Current < Val(interval)
  361. DoEvents
  362. Loop
  363. End Sub
  364.  
  365. Function AOLGetUser()
  366. On Error Resume Next
  367. AOL% = Findwindow("AOL Frame25", "America  Online")
  368. MDI% = FindChildByClass(AOL%, "MDIClient")
  369. Welcome% = FindChildByTitle(MDI%, "Welcome, ")
  370. WelcomeLength% = GetWindowTextLength(Welcome%)
  371. WelcomeTitle$ = String$(200, 0)
  372. A% = GetWindowText(Welcome%, WelcomeTitle$, (WelcomeLength% + 1))
  373. User = Mid$(WelcomeTitle$, 10, (InStr(WelcomeTitle$, "!") - 10))
  374. AOLGetUser = User
  375. End Function
  376.  
  377. Public Sub AOLIcons()
  378. AOL% = Findwindow("AOL Frame25", vbNullString)
  379. TL1% = FindChildByClass(AOL%, "AOL Toolbar")
  380. TL2% = FindChildByClass(TL1%, "_AOL_Toolbar")
  381. ICO1% = FindChildByClass(TL2%, "_AOL_Icon")
  382. ICO2% = GetWindow(ICO1%, 2)
  383. ICO3% = GetWindow(ICO2%, 2)
  384. ICO4% = GetWindow(ICO3%, 2)
  385. ICO5% = GetWindow(ICO4%, 2)
  386. ICO6% = GetWindow(ICO5%, 2)
  387. ICO7% = GetWindow(ICO6%, 2)
  388. ICO8% = GetWindow(ICO7%, 2)
  389. ICO9% = GetWindow(ICO8%, 2)
  390. ICO10% = GetWindow(ICO9%, 2)
  391. ICO11% = GetWindow(ICO10%, 2)
  392. ICO12% = GetWindow(ICO11%, 2)
  393. ICO13% = GetWindow(ICO12%, 2)
  394. ICO14% = GetWindow(ICO13%, 2)
  395. ICO15% = GetWindow(ICO14%, 2)
  396. ICO16% = GetWindow(ICO15%, 2)
  397. ICO17% = GetWindow(ICO16%, 2)
  398. ICO18% = GetWindow(ICO17%, 2)
  399. ICO19% = GetWindow(ICO18%, 2)
  400. ICO20% = GetWindow(ICO19%, 2)
  401. ICO21% = GetWindow(ICO20%, 2)
  402. ICO22% = GetWindow(ICO21%, 2)
  403. ICO23% = GetWindow(ICO22%, 2)
  404. ICO24% = GetWindow(ICO23%, 2)
  405. ICO25% = GetWindow(ICO24%, 2)
  406. ICO26% = GetWindow(ICO25%, 2)
  407. ICO27% = GetWindow(ICO26%, 2)
  408. End Sub
  409.  
  410. Public Function IMAnswer(Text)
  411. AOL% = Findwindow("AOL Frame25", vbNullString)
  412. MDI% = FindChildByClass(AOL%, "MDIClient")
  413. IM1% = FindChildByTitle(MDI%, ">Instant Message From: ")
  414. IM2% = FindChildByClass(IM1%, "RICHCNTL")
  415. IM3% = GetWindow(IM2%, 2)
  416. IM4% = GetWindow(IM3%, 2)
  417. IM5% = GetWindow(IM4%, 2)
  418. IM6% = GetWindow(IM5%, 2)
  419. IM7% = GetWindow(IM6%, 2)
  420. IM8% = GetWindow(IM7%, 2)
  421. IM9% = GetWindow(IM8%, 2)
  422. IM10% = GetWindow(IM9%, 2)
  423. IM11% = GetWindow(IM10%, 2)
  424. IM12% = GetWindow(IM11%, 2)
  425. IM13% = GetWindow(IM12%, 2)
  426. IM14% = GetWindow(IM13%, 2)
  427. IM15% = GetWindow(IM14%, 2)
  428. IM16% = GetWindow(IM15%, 2)
  429. IM17% = GetWindow(IM16%, 2)
  430. SNDTX% = SendMessageByString(IM15%, WM_SETTEXT, 0, Text)
  431. Click (IM16%)
  432. CLOSE1% = SendMessage(IM1%, WM_CLOSE, 0, 0&)
  433. End Function
  434.  
  435. Sub runmenu(menu1 As Integer, menu2 As Integer)
  436. Dim AOLWorks As Long
  437. Static Working As Integer
  438.  
  439. AOLMenus% = GetMenu(Findwindow("AOL Frame25", vbNullString))
  440. AOLSubMenu% = GetSubMenu(AOLMenus%, menu1)
  441. AOLItemID = GetMenuItemID(AOLSubMenu%, menu2)
  442. AOLWorks = CLng(0) * &H10000 Or Working
  443. ClickAOLMenu = SendMessageByNum(Findwindow("AOL Frame25", vbNullString), 273, AOLItemID, 0&)
  444.  
  445. End Sub
  446.  
  447. Public Sub RunMenuByString(Application, StringSearch)
  448.  
  449. ToSearch% = GetMenu(Application)
  450. MenuCount% = GetMenuItemCount(ToSearch%)
  451.  
  452. For FindString = 0 To MenuCount% - 1
  453. ToSearchSub% = GetSubMenu(ToSearch%, FindString)
  454. MenuItemCount% = GetMenuItemCount(ToSearchSub%)
  455.  
  456. For GetString = 0 To MenuItemCount% - 1
  457. SubCount% = GetMenuItemID(ToSearchSub%, GetString)
  458. MenuString$ = String$(100, " ")
  459. GetStringMenu% = GetMenuString(ToSearchSub%, SubCount%, MenuString$, 100, 1)
  460.  
  461. If InStr(UCase(MenuString$), UCase(StringSearch)) Then
  462. MenuItem% = SubCount%
  463. GoTo MatchString
  464. End If
  465.  
  466. Next GetString
  467.  
  468. Next FindString
  469. MatchString:
  470. RunTheMenu% = SendMessage(Application, WM_COMMAND, MenuItem%, 0)
  471. End Sub
  472.  
  473. Function ChatSend2(Text)
  474. AOL = Findwindow("AOL Frame25", vbNullString)
  475. If AOL = 0 Then Exit Function
  476. f = FindChildByClass(AOL, "MDIClient")
  477. b = FindChildByClass(f, "AOL Child")
  478.  
  479. start:
  480. c = FindChildByClass(b, "RICHCNTL")
  481. If c = 0 Then GoTo nextwnd
  482. d = FindChildByClass(b, "_AOL_Combobox")
  483. If d = 0 Then GoTo nextwnd
  484. e = FindChildByClass(b, "_AOL_Listbox")
  485. If e = 0 Then GoTo nextwnd
  486. findchatroom = b
  487. Exit Function
  488.  
  489. nextwnd:
  490. b = GetWindow(b, 2)
  491. If b = GetWindow(b, GW_HWNDLAST) Then Exit Function
  492. FNL% = FindChildByClass(b, "RICHCNTL")
  493. If FNL% <> 0 Then MsgBox "Found It!"
  494. One1% = GetWindow(FNL%, 2)
  495. Two2% = GetWindow(One1%, 2)
  496. Three3% = GetWindow(Two2%, 2)
  497. Four4% = GetWindow(Three3%, 2)
  498. Five5% = GetWindow(Four4%, 2)
  499. six6% = GetWindow(Five5%, 2)
  500. Seve7% = GetWindow(six6%, 2)
  501. Eight8% = GetWindow(Seve7%, 2)
  502.  
  503. lSnd% = SendMessageByString(six6%, WM_SETTEXT, 0, Text)
  504. 'Click (Seve7%)
  505. lEnter% = SendMessageByNum(six6%, WM_CHAR, 13, 0&)
  506. GoTo start
  507. End Function
  508.  
  509. Public Function Click2(hWnd)
  510. lEnter% = SendMessageByNum(hWnd, WM_CHAR, 13, 0&)
  511. End Function
  512.